package cn.zhentao.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

//相当于前端控制器
public class AppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
    @Override
    protected Class<?>[] getRootConfigClasses() {
        Class[] classes = new Class[]{SpringConfig.class};
        return classes;
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        Class[] classes = new Class[]{SpringConfig.class};
        return classes;
    }

    @Override
    protected String[] getServletMappings() {
        //拦截所有请求
        String[] strings = new String[]{"/"};
        return strings;
    }

}
